package com.lightsaber.trade.cloth.entity.param;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * RoleFuncId.
 */
@Embeddable
public class AwardId implements Serializable {

    private static final long serialVersionUID = 861716126340546086L;

    @Column(name = "JOIN_YEAR", nullable = true)
    private String joinYear;

    @Column(name = "SEMESTER", nullable = true, length = 3)
    private String semester;

    @Column(name = "AWARD", nullable = true, length = 25)
    private String award;

    public String getJoinYear() {
        return joinYear;
    }

    public void setJoinYear(final String joinYear) {
        this.joinYear = joinYear;
    }

    public String getSemester() {
        return semester;
    }

    public void setSemester(final String semester) {
        this.semester = semester;
    }

    public String getAward() {
        return award;
    }

    public void setAward(final String award) {
        this.award = award;
    }

    @Override
    public int hashCode() {
        return joinYear.hashCode() + semester.hashCode() + award.hashCode();
    }

    @Override
    public boolean equals(final Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }

        if (obj instanceof AwardId) {
            AwardId right = (AwardId) obj;

            return joinYear.equals(right.joinYear) && semester.equals(right.semester)
                    && award.equals(right.award);
        } else {
            return false;
        }
    }
}
